UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I8edkffl8XIsJFTOvJRL+ljfzpMe83GJesUxoxLNDL0='
WHERE
key_id = '4fae2fcb739398d34c62444332d1dd674ef256328682ef607260f2f94e0a568a'
AND (
token = 'I8edkffl8XIsJFTOvJRL+ljfzpMe83GJesUxoxLNDL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)