UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Xe7CKdEmi3HzR5vXBzqtyDDHMmhYkh4EnYdSEaPMzE=' 
WHERE 
  key_id = 'a30ae1e5faaef69b3c35d9c6b083f7cc12b83b82502d9a02362f23143eb3610a' 
  AND (
    token = '+Xe7CKdEmi3HzR5vXBzqtyDDHMmhYkh4EnYdSEaPMzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053