UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wH+UzcL6Dd7eTrIPCkekHEz4pxWzny6DrIXaZAC4qtA='
WHERE
key_id = 'b07c80a98e128417221d12d6d0a07640d316d18c312f902828092c7d9f875527'
AND (
token = 'wH+UzcL6Dd7eTrIPCkekHEz4pxWzny6DrIXaZAC4qtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)