UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ETyaKsOFNGjNqU8Cs8SbxRTTiU75S20MZre406HhEI=' 
WHERE 
  key_id = '25c5ab895f01461f1f45a6329ce680ab57a0bc7b485c1a2f3984263a20fbe9c1' 
  AND (
    token = '9ETyaKsOFNGjNqU8Cs8SbxRTTiU75S20MZre406HhEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035