UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BmUOZCfSAjURxJpYsQ/DfE3f6VJWVT70zambv4wLtUo='
WHERE
key_id = '06467d0a000b433362b386fc2b7d74ca387b92c9cdab029c5671c9febfde6a50'
AND (
token = 'BmUOZCfSAjURxJpYsQ/DfE3f6VJWVT70zambv4wLtUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)