UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BudY8HeoNo/N4SstNLBkhVJgak/KaK5xRfVbf6zMdr4='
WHERE
key_id = 'f3b20b732003a829c49dd40a2d49528bd079bf039c457fd3137ba24dd0a9972b'
AND (
token = 'BudY8HeoNo/N4SstNLBkhVJgak/KaK5xRfVbf6zMdr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)