UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NmzIwpHNYiK4j5SCEyrbPXGZp1/FDB6LGwnXhFXMKjk=' 
WHERE 
  key_id = 'f393cc604378fa2cf55c93f08c4a80c5b93b7186c460e1f8a254136634269f2a' 
  AND (
    token = 'NmzIwpHNYiK4j5SCEyrbPXGZp1/FDB6LGwnXhFXMKjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035