UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j+RazHam0OADaw87Gh7Z2CNjHs17GWs68Gg/KaFrK6A=' 
WHERE 
  key_id = '4c6cc57faf5b2d28d3e0f533ccb6234f4a74e53ca094b95042075bfe277b996b' 
  AND (
    token = 'j+RazHam0OADaw87Gh7Z2CNjHs17GWs68Gg/KaFrK6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035