UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ejVEJCjnyeVV50/QLZrAs6sx8/aisEgWyz04G1cWSrs='
WHERE
key_id = '04a5d6eb7b0784618f51b988a3a4ffcc0f33b8b2ddd9d106ac4d8ca501c8510a'
AND (
token = 'ejVEJCjnyeVV50/QLZrAs6sx8/aisEgWyz04G1cWSrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)