UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XWsq4Nz5Wwa/pwa5S8dtg0fMBHOJZ/Ni+aU37dSBcE='
WHERE
key_id = '36276ad9649c8794be5b076c52b2c52017f29c87105ab06175ac15c3bd0860ed'
AND (
token = '1XWsq4Nz5Wwa/pwa5S8dtg0fMBHOJZ/Ni+aU37dSBcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)