UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UkFHejNRuUBzxUfRfkFrGFn25TRzmRCizIR6H53H7PI='
WHERE
key_id = '52e3ca2af5d571bd82893c24d0a9c5bcb8b48da0fdb842742e884815b8a5480e'
AND (
token = 'UkFHejNRuUBzxUfRfkFrGFn25TRzmRCizIR6H53H7PI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)