UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vg6o7vYpSlDOoTVUO286pjR878zKOomr19zTp/NhF2k='
WHERE
key_id = '961084ae290a778b50c7be1bb2932f5b974e7eff0cad8ce0a555f2af929afd0f'
AND (
token = 'vg6o7vYpSlDOoTVUO286pjR878zKOomr19zTp/NhF2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)