UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fEWhWL69J9rFZ3IT2VYYN/XLOla3IkghGUHxptsT44c=' 
WHERE 
  key_id = '1378348d84d0eace0ff9d438d9a5f2ef00aef7466d1d9dc12f09ff47917fb11a' 
  AND (
    token = 'fEWhWL69J9rFZ3IT2VYYN/XLOla3IkghGUHxptsT44c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017