UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LJy6KUie5s0b5mvIrd1XWm0fMdjhuwlWz1bO5NYeJAo='
WHERE
key_id = 'a9951c1b32a880be9def65fbd34e3cba91719b5642ab5ee7d2190a9a41bb038c'
AND (
token = 'LJy6KUie5s0b5mvIrd1XWm0fMdjhuwlWz1bO5NYeJAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)