UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '07zeIASpzNH2lkSoWHHUxPilc+hQ/vnNov+eTmEjFKU=' 
WHERE 
  key_id = '5aabf1bef64262e13512342d0267a733b70f6c385819b7fd4af886a37512c291' 
  AND (
    token = '07zeIASpzNH2lkSoWHHUxPilc+hQ/vnNov+eTmEjFKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034