UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FzawOtceIKlfC3CMwunhlA1CIGnIAPt5Lce7a3Mx4Pw=' 
WHERE 
  key_id = '1535224572553c1552d636bd655b2c53c196cdcc1a033f21db1fab10d8ba2b33' 
  AND (
    token = 'FzawOtceIKlfC3CMwunhlA1CIGnIAPt5Lce7a3Mx4Pw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031