UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9EF2XF+zMYGG3gn8OmZtjfHpTXXSTrXUPAXYn8XXKGA=' 
WHERE 
  key_id = '764b0daf306264a86339e14c8ea303cf0da4bfab60c5ab3ecf901019b2b4c97b' 
  AND (
    token = '9EF2XF+zMYGG3gn8OmZtjfHpTXXSTrXUPAXYn8XXKGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030