UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tk+a8kRsTzRe6i+y+ZBIQvOPWlPyXHvhDtReV+ngDoM='
WHERE
key_id = '89070fbd153811bf5e229935a9de888ee7db6a863f56c78df87c29431a013fda'
AND (
token = 'Tk+a8kRsTzRe6i+y+ZBIQvOPWlPyXHvhDtReV+ngDoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)