UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GPQoAeUOfpsYRJYFkrwfPuCSCiQpgocR9HFjC9XVoYk='
WHERE
key_id = '752eb2df0af4514d93387489b958b17a0bcdaffc607b89330f30d1fd9fe84e42'
AND (
token = 'GPQoAeUOfpsYRJYFkrwfPuCSCiQpgocR9HFjC9XVoYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)