UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O5BGmFNvWBP7GaELXD3uf0YO9ntgddQC/+vv8AGOM04='
WHERE
key_id = '1b8155d54c29259028c5c1c8acee3db00d9626bf9b75c72981a87a4ae0e72825'
AND (
token = 'O5BGmFNvWBP7GaELXD3uf0YO9ntgddQC/+vv8AGOM04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)