UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KLCI8GN9PIgbHchS6jZ/aoUDiEuh9HSes82SgqgHRN8='
WHERE
key_id = '530e4f576dd01c956039944d4532d27c027befdc055ecb90d49228c6785d8d3c'
AND (
token = 'KLCI8GN9PIgbHchS6jZ/aoUDiEuh9HSes82SgqgHRN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)