UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bRLQi29OTsIc4Xa7xSlC1FIyIWK97HyMONC+UJ5IH2U=' 
WHERE 
  key_id = '4cc0c2c8de8d0fb7f71050e019430a652368416f77ad1181d5c6fed66034e16b' 
  AND (
    token = 'bRLQi29OTsIc4Xa7xSlC1FIyIWK97HyMONC+UJ5IH2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054