UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7gR4nD6F1vMvIhD3x7+qSRFWi1N3WKsETrnI6asp1/4=' 
WHERE 
  key_id = 'd21917c6bb2553ce10493534b227fbdf4ee69d66f26299f522edf10a649b64f1' 
  AND (
    token = '7gR4nD6F1vMvIhD3x7+qSRFWi1N3WKsETrnI6asp1/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029