UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JELhXSt2ovAUyeNDYTQ+KGqdI0LzhWE/VrbASWo3iLM='
WHERE
key_id = '2bfea4f8e6f2151bff9a0c72fe87f65cd2b4c7993f0944ebf15f603fcdab8f2f'
AND (
token = 'JELhXSt2ovAUyeNDYTQ+KGqdI0LzhWE/VrbASWo3iLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)