UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RFxg5dB7FQy6qb/YojpPEAy6L3tXvLbdpGP7ZbdD11c=' 
WHERE 
  key_id = '0f20fea811c21ed0d527ce1f48da26acf1d2b96d5fcda6e4dbb9b9513cbd3a90' 
  AND (
    token = 'RFxg5dB7FQy6qb/YojpPEAy6L3tXvLbdpGP7ZbdD11c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035