UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hUXU6wampnk/uUritY3BIRm5EM/hyOmusJmicgRdd0='
WHERE
key_id = 'cd6d6158e492bcd697576145e3fd604c082ba3209f48685b2e4c1dbd774ad892'
AND (
token = '3hUXU6wampnk/uUritY3BIRm5EM/hyOmusJmicgRdd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)