UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LQtrX6sT8qVffGk0fgJ2UuRtNon8TwlLCQ838I0uxhA='
WHERE
key_id = '963000653073444f18fc52c65a5f6085567b857fde08f077f1a0cdde311acb9a'
AND (
token = 'LQtrX6sT8qVffGk0fgJ2UuRtNon8TwlLCQ838I0uxhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)