UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PkVhESVnmJBF6WbV/anJwfqhdY4kZ1jE+puRyPC9+0o='
WHERE
key_id = '5b9233f918ac623e1827bcb73cc44ce2fd6724f17a6470e318a76f9d7b3374d6'
AND (
token = 'PkVhESVnmJBF6WbV/anJwfqhdY4kZ1jE+puRyPC9+0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)