UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1mx//nNQJcQhXIHDylO/Bt7bj0DRa66FonYb8WBy4C8='
WHERE
key_id = '87ba11a4cdd8eedd9de384d7b3a13fc2ce80ffd7122e51bc64136badc5961d0b'
AND (
token = '1mx//nNQJcQhXIHDylO/Bt7bj0DRa66FonYb8WBy4C8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)