UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X+gMsUufuH8AruZbsDFFrEiH/rf86f4lzlgJFHpZaEA='
WHERE
key_id = '26de11f8f68415c7c8282ad896b4e212e03e957f3928fb6b80f853a838b02d4e'
AND (
token = 'X+gMsUufuH8AruZbsDFFrEiH/rf86f4lzlgJFHpZaEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)