UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fxGgWfl2D7UmMVrItjpYB61sk8sGp0gXrGuiuvHkdWE='
WHERE
key_id = '023453869c3f6f777cdd678e2758d64734fa6ad7f8d477b46184400e2de12449'
AND (
token = 'fxGgWfl2D7UmMVrItjpYB61sk8sGp0gXrGuiuvHkdWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)