UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lzhtqvC1rEHL+awf/4WZBGoVDs6hQ8buaNk9FSn0xcc='
WHERE
key_id = '466701973b08bf04ad7c00bcae8215c17bb43b12c9baff71c20b501ef054f01d'
AND (
token = 'lzhtqvC1rEHL+awf/4WZBGoVDs6hQ8buaNk9FSn0xcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)