UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JTz8Pk3wlbxqX3zXwm+DhZDf2HHa6SLiLNsLZ4RaMfc=' 
WHERE 
  key_id = '05d8766e2b101b7bb33db6aaad64c40861fe16fd9f8e2ff3da7858c8bdd5a905' 
  AND (
    token = 'JTz8Pk3wlbxqX3zXwm+DhZDf2HHa6SLiLNsLZ4RaMfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056