UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JWBm89VjHzX9m1DNzvhiLzkfdMfXVEigyItR33A8cJg='
WHERE
key_id = '418537152af0f878d461951dfac7c61e2b90aab5707149aabd44fb19dc53be4b'
AND (
token = 'JWBm89VjHzX9m1DNzvhiLzkfdMfXVEigyItR33A8cJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)