UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a3nyX2CElsNGvfeTJv3qofx9CahCe3YTu1eXJTggpEY=' 
WHERE 
  key_id = '1cbb2d4bf3c57d3cb33b0bdabff8554e29d7dad14be6d6cb0b01e4034dad59ad' 
  AND (
    token = 'a3nyX2CElsNGvfeTJv3qofx9CahCe3YTu1eXJTggpEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024